import buildingApi from '@/config/server/api/building';

function names(housesName) {
  return buildingApi.house.names.fetch({housesName}).then(res => {
    return res.list.map(item => {
      item.key = item.housesId + '-' + item.orgId
      item.value = item.housesName + '（' + item.orgName + '）'
      return item
    })
  })
}

function record(housesId) {
  return buildingApi.house.record.fetch({housesId})
}

export default {
  names,
  record
}
